package com.example.demo.controller;

import com.example.demo.model.Book;
import com.example.demo.service.SearchServiceMysql;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 功能描述：
 *
 * @Author: Zhanghf
 * @Date: 2021/12/19 14:47
 */
@RestController
public class ServiceController {
    @Autowired
    private SearchServiceMysql searchServiceMysql;

    @PostMapping("searchbymysql")
    public List<Book> searchbymysql(@RequestParam("keyWord")String keyWord) {

return searchServiceMysql.search(keyWord);

    }
}